#include <iostream>

using namespace std;

class MyClass
{
private:
    int privateMember;

public:
    MyClass(int x) : privateMember(x) {}
    // 声明友元函数
    friend void friendFunction(MyClass &obj);
};

void friendFunction(MyClass &obj)
{
    // 访问 privateMember
    cout << "Private Member: " << obj.privateMember << endl;
    obj.privateMember = 10;
    cout << "Private Member: " << obj.privateMember << endl;
}

int main()
{
    MyClass myObj(11);
    friendFunction(myObj);
    return 0;
}